package com.jiao.testdemo.pattern.iterator;

import java.util.List;

/**
 * TODO(文件概要)
 *
 * <p> TODO(具体描述信息,可以不填)
 *
 * @author meetsocial
 * @version V1.0
 * @className: ConcreteIterator
 * @date 2024/11/15 10:47
 */
public class ConcreteIterator implements Iterator{

    private List<Object> items;
    private int position;

    public ConcreteIterator(List<Object> items) {
        this.items = items;
    }

    @Override
    public boolean hasNext() {
        return position < items.size();
    }

    @Override
    public Object next() {
        return items.get(position++);
    }
}
